/**
 * 
 */
package due.pc.pcshoot.entity;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;

import android.content.Context;

import due.pc.pcshoot.MainActivity;

/**
 * @author manhhung.vu
 *
 */
public class Ground extends Sprite 
{
	//===============================================================/
	//Constants
	//===============================================================/
	public static final String GROUND_IMAGEPATH = "gfx/ground.png";
	
	//===============================================================/
	//Fields
	//===============================================================/
	
	
	//===============================================================/
	//Constructors
	//===============================================================/
	public Ground(float pX, float pY, TextureRegion pTextureRegion) {
		super(pX, pY, pTextureRegion);
	}
	
	//===============================================================/
	//Inherited Methods
	//===============================================================/
	
	
	//===============================================================/
	//Methods
	//===============================================================/
	
	
	//===============================================================/
	//Getters & Setters
	//===============================================================/
	
	
	//===============================================================/
	//Static Methods
	//===============================================================/
	public static Ground createGround(Engine peEngine, Context pContext) 
	{
		Texture texture = new Texture(MainActivity.VIEW_WIDTH, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
		TextureRegion textureRegion = TextureRegionFactory.createFromAsset(
				texture, pContext, GROUND_IMAGEPATH, 0, 0);
		peEngine.getTextureManager().loadTexture(texture);
		
		return new Ground(MainActivity.VIEW_X, MainActivity.VIEW_Y + MainActivity.VIEW_HEIGHT - 50, textureRegion);
	}
	
	
	//===============================================================/
	//Inner Classes
	//===============================================================/
}
